package com.siwei.mes.service.system.impl;

import com.siwei.mes.entity.system.SystemParam;
import com.siwei.mes.mapper.system.SystemParamMapper;
import com.siwei.mes.service.system.SystemParamService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 品控系统参数(SystemParam)表服务实现类
 *
 * @author linzi
 * @since 2024-09-18 17:24:11
 */
@Service
public class SystemParamServiceImpl implements SystemParamService {
    @Resource
    private SystemParamMapper systemParamMapper;

    @Override
    public String selectBySystemCode(String systemParamCode, String defaultValue) {
        SystemParam systemParam = systemParamMapper.selectBySystemCode(systemParamCode);
        if (systemParam == null) {
            return defaultValue;
        } else {
            return systemParam.getSystemValue();
        }
    }
}
